home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / GTFLSTNG.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  1016 b   |  32 lines

  1. #include <stdio.h>
  2. #include <graphics.h>
  3. /* Define the pattern names */
  4. char *patname[] =
  5. { "Empty", "Solid", "lines", "Thin slashes",
  6.   "Thick slashes", "Thick backslashes",
  7.   "Thin backslashes", "Hatch", "Crosshatch",
  8.   "Interleaving lines", "widely spaced dots",
  9.   "Closely spaced dots", "User defined pattern"};
  10.  
  11. main()
  12. {
  13.    int graphdriver = DETECT, graphmode;
  14.    struct fillsettingstype fsettings;
  15.    char buffer[80];
  16.  
  17. /* Initialize the graphics system */
  18.    initgraph(&graphdriver, &graphmode, "c:\\turboc");
  19.    outtextxy(10, 20, "Demonstrating getfilsettings");
  20.  
  21. /* Get current fill settings and describe them */
  22.    getfillsettings(&fsettings);
  23.    sprintf(buffer, "Fill pattern is %s, fill color = %d",
  24.        patname[fsettings.pattern], fsettings.color);
  25.    outtextxy(10, 60, buffer);
  26.    outtextxy(10, 80, "Here's how it looks");
  27.    bar(100, 100, 120, 200);
  28. /* Give user a chance to see the result */
  29.    outtextxy(10, 220, "Hit any key to exit:");
  30.    getch();
  31.    closegraph();
  32. }